using System;
using System.Xml.Serialization;

namespace Jonathan.Classes
{
	/// <summary>
	/// This is an object that will hold information about a passage (version, book, chapter, verse).
	/// </summary>
    [Serializable]
    public class CPassage
    {
        private string m_Book;
        private string m_Chapter;
        private string m_Verse;
        private string m_Version;

        /// <summary>
        /// Creates a new icBookMark...
        /// </summary>
        public CPassage () : this("", "")
        {
        }

        /// <summary>
        /// Creates a new Passage with the given information...
        /// </summary>
        /// <param name="book">Book of Passage.</param>
        /// <param name="chapter">Chapter of Passage.</param>
        public CPassage (string book, string chapter)
            : this(book, chapter, "")
        {
        }

        /// <summary>
        /// Creates a new Passage with the given information...
        /// </summary>
        /// <param name="book">Book of Passage.</param>
        /// <param name="chapter">Chapter of Passage.</param>
        /// <param name="verse">Verse of Passage.</param>
        public CPassage (string book, string chapter, string verse)
            : this("", book, chapter, verse)
        {
        }

        /// <summary>
        /// Creates a new Passage with the given information...
        /// </summary>
        /// <param name="version">Version of Passage.</param>
        /// <param name="book">Book of Passage.</param>
        /// <param name="chapter">Chapter of Passage.</param>
        /// <param name="verse">Verse of Passage.</param>
        public CPassage (string version, string book, string chapter, string verse)
        {
            this.m_Book = book;
            this.m_Chapter = chapter;
            this.m_Verse = verse;
            this.m_Version = version;
        }

        /// <summary>
        /// Gets or Sets the Book...
        /// </summary>
        [XmlAttribute]
        public string Book
        {
            get { return this.m_Book; }
            set { this.m_Book = value; }
        }

        /// <summary>
        /// Gets or Sets the Chapter...
        /// </summary>
        [XmlAttribute]
        public string Chapter
        {
            get { return this.m_Chapter; }
            set { this.m_Chapter = value; }
        }

        /// <summary>
        /// Gets or Sets the Verse...
        /// </summary>
        [XmlAttribute]
        public string Verse
        {
            get { return this.m_Verse; }
            set { this.m_Verse = value; }
        }

        /// <summary>
        /// Gets or Sets the Version...
        /// </summary>
        [XmlAttribute]
        public string Version
        {
            get { return this.m_Version; }
            set { this.m_Version = value; }
        }

        /// <summary>
        /// Convert the passage to a string...
        /// </summary>
        /// <returns>String representation of Passage</returns>
        public override string ToString ()
        {
            return this.Book + " " + this.Chapter + ":" + this.Verse;
        }
    }
}
